Skip to content

Fix stale MPP APIs and rename Channel mode to Session - #71

Merged
kaankacar merged 2 commits into
mainfrom
fix-mpp-section
Aug 10, 2026
Merged

Fix stale MPP APIs and rename Channel mode to Session#71
kaankacar merged 2 commits into
mainfrom
fix-mpp-section

Conversation

@kaankacar

@kaankacar kaankacar commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Closes #60. Closes #57.

Applies @jeesunikim's on-chain-verified corrections from #60, each re-checked against the published packages before writing (npm view mppx@0.6.29 exports confirms the subpath map and that the root exports no usable Mppx/Store; npm view confirms the @stellar/mpp@0.7.1 peer pins):

  • mppx.middleware() is gone from both servers. Mppx.create on the mppx/express adapter returns per-route handlers, mounted per paid route with the price set there — the old examples never set an amount anywhere.
  • Imports corrected to the real subpaths (mppx/express, mppx/server, mppx/client, client re-export via @stellar/mpp/charge/client), and the package table now maps them explicitly with a warning about the bare root.
  • The charge server passes the required store: Store.memory(), with a new error-keyed pitfall for the startup throw.
  • Client progress events corrected to challenge | signing | signed | paying | confirming | paid with event.hash.
  • Install pins express@^5 / stellar-sdk@^15 plus a note on the peer-dependency ERESOLVE failure, and a matching pitfall.

Terminology per #57: the mode is now Session everywhere (decision table, headings, pitfalls, frontmatter, site card), with a naming callout that keeps "Channel mode" as a documented synonym and reserves "channel" for the settlement mechanism — contract, deposit, close flows keep their mechanism wording, as recommended.

Verification: all four examples in the diff type-check exactly as written against the published packages (mppx 0.6.31, @stellar/mpp 0.7.1, stellar-sdk 15.1.0, express 5.2.1), including the session server's per-route mppx.channel({ amount, description }) handler. A negative control confirms the types are real rather than any: mppx.middleware() fails with property-does-not-exist, a typo'd route option is rejected with the exact { amount, description, expires, meta, scope } schema, and comparing an event to "settled" fails against the real challenge | signing | signed | paying | confirming | paid union — the compiler reproduces #60's findings verbatim.

API fixes, all from the on-chain-verified report in #60 and re-checked
against the published packages (mppx exports map and peer deps via npm):

- mppx.middleware() does not exist; Mppx.create on the mppx/express
  adapter returns per-route handlers, and the price is set per route
  (the old examples never set an amount anywhere)
- the bare mppx root exports neither Mppx nor Store; imports now use
  mppx/express, mppx/server, and mppx/client subpaths, with the
  package table corrected
- charge mode requires a store; the charge server now passes
  Store.memory() and a pitfall documents the startup error
- client progress events are challenge/signing/signed/paying/
  confirming/paid with the hash on event.hash, not settled/txHash
- install line pins express@^5 and stellar-sdk@^15 with a note on the
  @stellar/mpp peer-dependency pins and the ERESOLVE failure

Terminology per #57: the payment intent is now called Session
(channel-backed); Channel stays as the name of the settlement
mechanism and as a documented synonym for searchability.

Closes #60. Closes #57.
Copilot AI review requested due to automatic review settings July 20, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-10 23:30 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (4)

skills/agentic-payments/SKILL.md:603

  • The package-reference install is still unpinned even though this table documents the 0.6.x subpaths. Because @stellar/mpp@0.7.1 requires mppx@^0.6.29 and newer incompatible mppx releases exist, pin this second command too.
| `mppx/express` | `import { Mppx } from "mppx/express"` — Express adapter; `Mppx.create(...)` returns per-route handlers |

skills/agentic-payments/SKILL.md:395

  • Pin the compatible MPP pair in this command. @stellar/mpp@0.7.1 declares mppx@^0.6.29, while an unversioned mppx now resolves past 0.6.x, so this advertised install can fail with ERESOLVE before the examples run.

This issue also appears on line 603 of the same file.

npm install express@^5 @stellar/mpp mppx @stellar/stellar-sdk@^15 dotenv

skills/agentic-payments/SKILL.md:3

  • The Session rename is not yet repository-wide: README.md:84 still advertises MPP (Charge + Channel), so the top-level skill index continues presenting Channel as the public mode. Update that entry to Charge + Session before closing #57.
description: Agentic and machine-to-machine payments on Stellar. Covers x402 (HTTP 402 paid APIs via OZ Channels facilitator, fee-sponsored clients) and MPP (Machine Payments Protocol) in both Charge mode (per-request SAC) and Session mode (channel-backed off-chain commits, high-frequency; formerly called Channel mode). Defaults to USDC (SEP-41 SAC) on `stellar:testnet`/`stellar:pubnet` (CAIP-2). Use when selling a paid API to AI agents, building an x402 client, or designing a payment-channel architecture for high-frequency agent traffic.

skills/agentic-payments/SKILL.md:607

  • This warning is inaccurate for the documented mppx@^0.6.29 line: the bare root re-exports Store, including the usable Store.memory() factory. Only Mppx is absent there. Keep recommending role-specific subpaths, but do not claim that Store is unavailable.
> The bare `mppx` root does **not** export a usable `Mppx` or `Store` — always import from the subpaths above.

@kaankacar

Copy link
Copy Markdown
Contributor Author

Re-verified every item in #60 against the published packages before merging. Installed exactly what the skill's install line produces (mppx@0.6.31, @stellar/mpp@0.7.1, @stellar/stellar-sdk@15.1.0, express@5.2.1 — npm's peer resolution pins mppx to 0.6.31 on its own, so the bare mppx in the install line is safe even though 0.8.17 is latest), then type-checked all four MPP examples verbatim out of the diff: clean, exit 0.

The negative controls reproduce #60's findings exactly, which is what makes the clean pass meaningful:

neg1.js:32 - error TS2339: Property 'middleware' does not exist on type 'Wrap<Mppx<readonly [Server<...
neg2.js:34 - error TS2561: Object literal may only specify known properties, but 'descriptionn'
             does not exist in type '{ description?: string; expires?: DatetimeInput; meta?: ...
neg3.js:15 - error TS2367: This comparison appears to be unintentional because the types
             '"challenge" | "confirming" | "paid" | "paying" | "signed" | "signing"' and
             '"settled"' have no overlap.

Finding 3 reproduces at runtime too — stellar.charge({...}) without a store throws [stellar:charge] A store is required for charge mode. Provide a Store instance for replay protection and transaction hash deduplication., and is accepted once store: Store.memory() is passed.

One correction pushed in 385c3ab: the note under the package table claimed the bare mppx root exports "no usable Mppx or Store". Mppx is genuinely absent, but Store is exported from the root — it's the identical object (Store === Store from mppx/servertrue), Store.memory() works from it, and it type-checks in a real charge config. That overstatement came from #60's own heading, so it travelled in honestly. Reworded to keep the subpath guidance without asserting something false.

Terminology per #57 checks out: the only two remaining "Channel mode" mentions are the deliberate synonym callouts (frontmatter + the naming note), and every other "channel" refers to the settlement mechanism. Site build, lint, and tsc all green. Merging.

@kaankacar
kaankacar merged commit 6f4696a into main Aug 10, 2026
6 checks passed
@kaankacar
kaankacar deleted the fix-mpp-section branch August 10, 2026 23:29
kaankacar added a commit that referenced this pull request Aug 11, 2026
Three scenarios per skill plus cross-skill routing checks and an
off-topic negative control, in the {skills, query, expected_behavior}
format with optional machine_checkable assertions. evals/README.md
documents the tiers (compile checks, LLM-judged behavior, trigger
checks), the baseline process, and how to run a scenario; the root
README links it and documents the 500-line router convention.

Scenario expectations reflect current protocol reality rather than the
July proposal where they diverged: Noir/UltraHonk verifies on-chain
since Protocol 26 (#72), MPP Channel mode is now Session (#71), and
getLedgers depth is provider-retention dependent (#73).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stale methods and incorrect information in mpp section Use MPP Session as the public mode name; keep channel as the mechanism

2 participants